package com.rui.cn.feignservice;


import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.baomidou.mybatisplus.service.IService;
import com.rui.cn.consumer.common.FeignClientConfig;
import com.rui.cn.entity.system.SysRole;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 角色 服务类
 * </p>
 *
 * @author zhang123
 * @since 2018-01-14
 */
@FeignClient(value="CLOUD-ZUUL-GATEWAY",configuration=FeignClientConfig.class)
public interface SysRoleService{

    /**查询角色列表
     * @param id
     * @return
     */
    @GetMapping(value = "/cloud/permission-proxy/sysrole/getRoleList/{id}")
    List<SysRole> getRoleList(@PathVariable("id")Integer id);

    @PostMapping(value = "/cloud/permission-proxy/sysrole/roleList")
    Page<SysRole> roleList(@RequestBody Pagination pagination, @RequestParam(required = false,name = "search") String search, @RequestParam(required = false,name = "sortBy") String sortBy, @RequestParam(required = false,name = "order") String order);

    @GetMapping(value = "/cloud/permission-proxy/sysrole/selectUserRole/{id}")
    List<SysRole> selectUserRole(@PathVariable("id") Integer id);

    @GetMapping(value = "/cloud/permission-proxy/sysrole/selectList")
    List<SysRole> selectList();

    @PutMapping(value = "/cloud/permission-proxy/sysrole/updateById")
    boolean updateById(@RequestBody SysRole role);

    @PostMapping(value = "/cloud/permission-proxy/sysrole/insert")
    boolean insert(@RequestBody SysRole role);

    @GetMapping(value = "/cloud/permission-proxy/sysrole/selectById/{id}")
    SysRole selectById(@PathVariable("id") Integer id);

    @DeleteMapping(value = "/cloud/permission-proxy/sysrole/deleteBatchIds")
    boolean deleteBatchIds(@RequestBody List<Integer> integers);
}
